//2009/09/11 12:24:51
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class BigCube
{
public:
    string largestCube(vector <string> range)
    {
        vector<pair<long long, long long> > v(range.size());
        for (int i=0; i<range.size(); i++)
        {
            stringstream s(range[i]);
            long long a, b;
            char c;
            s >> a >> c >> b;
            v[i].first = a;
            v[i].second = b;
        }
        sort(v.begin(), v.end());
        for (long long i=100000; i>=0; i--)
        {
            for (int j=v.size()-1; j>=0; j--)
            {
                if (i*i*i >=v[j].first && i*i*i <=v[j].second)
				{
					stringstream s;
					s << i*i*i;
                    return s.str();
				}
            }
        }
        return "";
    }
};
